<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .app{
            background-color: pink;
            height: 300px;
        }
    </style>
    <script src="js/jquery.min.js"></script>
</head>
<body>
    <h1>SPA 单页面应用程序</h1>
    <a href="#">登录页</a>
    <a href="#">主页</a>
    <hr />
    <div class="app">
        动态替换
    </div>
</body>
<script>
$(function(){
    $("a").eq(0).click(function(){
        $(".app").load("login.html");
    })
    $("a").eq(1).click(function(){
        $(".app").load("main.html");
    })
})
</script>
</html>